set terminal pdf
set output 'results.pdf'

set xlabel 'Matrix Size'
set ylabel 'Runtime [us]'

set logscale x
set logscale y
set grid

do for [i=0:3] {
	t = sprintf('gcc -O%i', i)
	set title t
	spfile = sprintf('./data/res_sp_o%i.txt', i)
	dpfile = sprintf('./data/res_dp_o%i.txt', i)
	epfile = sprintf('./data/res_ep_o%i.txt', i)
	plot spfile using 1:2 title "Single Precision" with linespoints smooth unique, dpfile using 1:2 title "Double Precision" with linespoints smooth unique, epfile using 1:2 title "Extended Precision" with linespoints smooth unique
}

t = sprintf('gcc -Ofast')
set title t
spfile = sprintf('./data/res_sp_ofast.txt')
dpfile = sprintf('./data/res_dp_ofast.txt')
epfile = sprintf('./data/res_ep_ofast.txt')
plot spfile using 1:2 title "Single Precision" with linespoints smooth unique, dpfile using 1:2 title "Double Precision" with linespoints smooth unique, epfile using 1:2 title "Extended Precision" with linespoints smooth unique
